1. Field of the Invention
The present invention relates to an imaging apparatus, imaging apparatus control method, and computer program, and more particularly relates to an imaging apparatus, imaging apparatus control method, and computer program whereby rapid and accurate autofocus processing as to a target subject.
2. Description of the Related Art
With a recent great number of imaging apparatuses such as still cameras, video cameras, and so forth, an autofocus (AF) mechanism for automatically focusing on a subject is implemented.
As for this autofocus control technique, a technique has been known wherein a contrast level of imaged data obtained through a lens is determined. Specifically, this technique is a technique wherein a specific region of an imaged image is set as a signal obtaining region (space frequency extraction area) for focus control, determination is made that the higher the contrast of this specific region is, the more the imaged image is in focus, and the lower the contrast is, the more the imaged image is out of focus, and a lens is driven to move a position to enhance the contrast, thereby adjusting focus. Such a focus control processing arrangement has been described, for example, in Japanese Unexamined Patent Application Publication No. 10-21373.
Specifically, there is applied a method wherein the high-frequency components of a specific region are extracted, integration data of the extracted high-frequency components is generated, and a contrast level is determined based on the generated high-frequency component integration data. That is to say, multiple sheets of images are obtained while moving a focus lens to multiple positions, and the brightness signals of each image are subjected to filter processing represented by a high-pass filter, thereby obtaining an AF evaluation value indicating the contrast intensity of each image. At this time, in a case wherein there is a subject which is in focus at a certain focus position, the AF evaluation value as to the focus position draws a curve such as shown in FIG. 1. The peak position P1 of this curve, the position where the contrast value of an image becomes the maximum is a focal position where the image is in focus. This method is for detecting the peak of contrast intensity, and is also referred to as a climbing method.
With this method, focusing operation can be performed, which is focus control using the information of an image reflected to an imager, there is no need to provide a ranging optical system in addition to an imaging optical system, and accordingly, this method has been employed widely with recent digital cameras.
Thus, with autofocus control, the high-frequency component integration value of a specific region is calculated to determine a contrast level, thereby employing this as an evaluation value (AF evaluation value). A focus lens is driven such that the evaluation value becomes the maximum, thereby realizing autofocus. In order to perform autofocus, there is a need to drive a lens with the above-mentioned evaluation value as an indicator. As for a lens driving mechanism, for example, a voice coil motor or the like is employed.
Note however, an autofocus (hereafter, abbreviated to “AF”) device employing a contrast extraction method for selecting a focus position with such contrast as an index value is apt to focus on a background including a great number of high-frequency components. For example, as shown in FIG. 2, a desired subject positioned at a central frame 20 or the like, which is the central portion of an screen overall frame 10 equivalent to the overall region of a shot image shot at an imaging apparatus, is out of focus, and consequently, a phenomenon called background focus occurs in some cases wherein a background is erroneously focused on.
Particularly, this background focus occurs markedly in a case wherein a subject is a face or the like. This is because a face is low in contrast as compared to a background portion, and consequently, a background portion having high contrast is taken as the best focus position of the screen overall frame 10.
If a correct subject can be recognized, it becomes possible to focus on a correct subject. That is to say, in a case wherein, with the settings such as shown in FIG. 2, a correct subject is taken as a person's face, correct focus control as to the target subject can be performed by recognizing this face, setting a ranging area (detection frame) where contrast is detected to perform focus control of a face frame 30, and performing focus control by contrast extraction restricted to the ranging area (detection frame).
With usual camera shooting, there are a great number of cases wherein a person is the principal subject, but a person takes various positions within an image to be shot, and accordingly, there are various types of pictorial composition. In order to handle such a problem, an arrangement has been proposed wherein a face is recognized from an image at an imaging apparatus, and a ranging area is set to the position of the recognized face, whereby focusing on the face can be performed regardless of the composition. For example, a focus control arrangement based on such face recognition has been disclosed in Japanese Unexamined Patent Application Publication No. 2003-107335. This focus control based on face recognition enables suitable focus control (focusing) with shooting of various types of composition.
Some digital still cameras having such a face recognition function already employed, wherein this function is employed in the case of shooting an image including a face. Note however, there has been no case of commercialization of such a video camera. Video cameras are for shooting moving images, the movement of a face region itself occurs, so applying face recognition to autofocus at the time of taking a moving image frequently collapses, so the current state is that practical realization is difficult.
With regard to an arrangement applying a person extraction technique from image data to a camera, for example, there is Japanese Unexamined Patent Application Publication No. 2004-317699 wherein an arrangement for determining a focus position based on a face size at high speed has been disclosed. Also, a distance estimation technique for executing distance measurement up to a subject based on the principle of triangulation has been described in Japanese Unexamined Patent Application Publication No. 2001-215403.
Also, an arrangement for performing processing for switching a contrast extraction area, for example, between the central frame 20 and face frame 30 shown in FIG. 2 has been disclosed in the above-mentioned Japanese Unexamined Patent Application Publication No. 2004-317699, Japanese Unexamined Patent Application Publication No. 2006-33440, and so forth.
Also, Japanese Unexamined Patent Application Publication No. 2006-227080 has disclosed a technique wherein a ranging area (detection frame) is set by adding a body portion to a face in light of a case wherein a face is low in contrast. Also, a technique relating to specification of the priority order of face frames in a case wherein multiple faces are included has been disclosed in Japanese Unexamined Patent Application Publication No. 2005-86682.
Note however, such related art is an application corresponding to digital still cameras, and as described above, in the case of applying a face frame to a moving image taken by a video camera as such a ranging area (detection frame), there is a need to detect the face frame for each frame of the video camera. Also, when increasing frame size, a background focus problem occurs, and when reducing frame size, a problem readily occurs in that focusing is not performed correctly due to framing out or low contrast of a frame, and consequently, a focus position fluctuates. Such various problems prevent practical realization.
Note that, in a case wherein a face region is employed as a ranging area (detection frame), there is a problem in that a detection signal from the detection frame set to the face region becomes unstable, but for example, Japanese Unexamined Patent Application Publication No. 2006-162215 has disclosed, as one of solution techniques for this problem, an arrangement wherein in the case of no detection from the detection frame being performed, the detection frame is held at a face detection area.
Note that, in addition to focus position settings based on the above-mentioned contrast determination, a technique has also been disclosed wherein the distance up to a face is measured based on a face size of an image obtained from a camera to estimate a focus position. Note however, face sizes differ between adults and children. Accordingly, with distance estimation based of a face size, it is desirable to perform estimation based on a face type classification such as an adult's face, child's face, and so forth. A technique has been disclosed in, for example, Japanese Unexamined Patent Application Publication Nos. 2003-242486, 11-175724, 8-106519, 2001-256496, 2001-167110, and 2001-331799, and so forth, wherein determination of face attributes (adult, child, etc.) is made by clustering of the feature amount of faces, or the like, and this determination results are employed to estimate the distance up to a face from a face size of an image obtained from a camera.